package cn.ekuma.epos.crm.model;

import com.openbravo.bean.crm.CustomerContact;
import com.openbravo.format.Formats;
import com.openbravo.pos.base.AppLocal;

import cn.ekuma.data.ui.swing.AbstractDTOTableModel;

public class CustomerContactTableModel extends AbstractDTOTableModel<CustomerContact>{

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		CustomerContact obj=this.getObj(rowIndex);
		switch(columnIndex){
		    case 0:
			    return Formats.TIMESTAMP.formatValue(obj.getContactTime());
		    case 1:
		    	return obj.getPriority();
		    case 2:
		    	return obj.getContactType();
		    case 3:
		    	return obj.getCustomerUser();
		    case 4:
		    	return obj.getUser();
		    case 5:
		    	return obj.getMemo();
		    case 6:
		    	return obj.getResult();
		    case 7:
		    	return Formats.TIMESTAMP.formatValue(obj.getFollowUpTime());	
		}
		return null;
	}

	@Override
	public String[] getColumnNames() {
		return new String[]{
				AppLocal.getIntString("label.contactTime"),
				AppLocal.getIntString("label.priority"),
				AppLocal.getIntString("label.contactType"),
				AppLocal.getIntString("label.customerUser"),
				AppLocal.getIntString("label.user"),
				AppLocal.getIntString("label.notes"),
				AppLocal.getIntString("label.result"),
				AppLocal.getIntString("label.followUpTime")
		};
	}

}
